<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <!-- 

        text-align:
            设置一个盒子中，文本的对齐方式，默认是左对齐。


        text-align除了设置一个文本的对齐方式之外，还可以设置行内块元素的对齐方式。
        
     -->
    <style>
        .box {
            border: 1px solid red;
            text-align: center;
        }

        .box2 {
            border: 1px solid blue;
            text-align: center;
        }

        .box3 {
            border: 1px solid green;
            text-align: center;
        }

        .box4 {
            border: 1px solid gold;
            text-align: center;
        }

        .box5 {
            border: 1px solid blue;
            text-align: center;
        }
        .box6 {
            border: 1px solid green;
            text-align: center;
        }
        .box6 .son{
             /* margin:0 auto; 可以让一个块级元素水平居中，原因后面讲到盒子模型时会说的 */
             margin: 0 auto;
        }
        .box7{
            border: 1px solid pink;
            /* justify设置两端对齐，只对英文有效 */
            text-align: justify;
            text-align-last: justify;
        }
    </style>
</head>

<body>

    <div class="box">我是一个DIV</div>
    <div class="box2">
        <input type="text">
    </div>
    <div class="box3">
        <img src="https://gw.alicdn.com/imgextra/i3/O1CN01uRz3de23mzWofmPYX_!!6000000007299-2-tps-143-59.png" alt="">
    </div>
    <div class="box4">
        <span>SPAN</span>
        <a href="#">A标签</a>
    </div>
    <div class="box5">
        <!-- 里面的div也是块级元素，独占一行，宽度没有指定，默认宽度是父元素的100% -->
        <!-- 给box5设置了text-align: center;  这个属性有继承性，里面的盒子继承了这个属性 -->
        <div style="background-color: skyblue;">DIV</div>
    </div>
    <div class="box6">
        <!-- text-align：center，并不能让一个块级元素水平居中 -->
        <div class="son" style="width: 100px; background-color: gold;">DIV</div>
    </div>
    <div class="box7">
        Love to us human is what water to fish.Love shines the most beautiful light of humanity,we born in it,we live by it.Too often we take it as granted,but we should know love is a priceless gift we should cherish.But how to cherish the love?I have heard a saying :the quickest way to receive love is to give it; the fastest way to lose love is to hold it too tightly the best way to keep love is to give it wings.
    </div>
</body>

</html>